<?php
class UnitTest  extends CI_Controller{
    function tLock($pdw,$id,$unlimit){
        $this->load->service('/wms/inventory_on_order_service');  
        //var_dump($this->inventory_on_order_service);
         echo "Go .....";
         if($pdw<>'pdw8585'){
             exit;
         }
         echo '##';
         $id=$id;
//         echo "#".$id;
//         exit;
         $this->load->model("common_model");
         $productFirst = $this->common_model->selectFirst('mt_product', array('id' => $id));
         $status_id = $productFirst['status_id'];
         $orderFirst = $this->common_model->selectFirst('mt_order', array('id' => $productFirst['oid']));
         $serviceType = $orderFirst['service_type'];
        //#状态
         $statusFirst = $this->common_model->selectFirst('mt_product_status', array('id' => $productFirst['status_id']));
         $nextStatus = $statusFirst['next_status_' . $serviceType];
        //#配件
         echo $id."@@";
         $partsList = $this->common_model->selectCustom('mt_product_parts', array('pid' => $id));
         $partStatusArr = array();
         foreach ($partsList as $rs) {
            $partStatusArr[] = $rs['status'];
         }
        $merchant_num=$productFirst['brandCustomerNum'];
        $warranty=$productFirst['inWarranty'];
        
        print_r($partsList);
        //exit;
        $rs = $this->inventory_on_order_service->set_onorder_parts_list_t($partsList, $merchant_num, $warranty, $in_or_out = 'out',$unlimit);
        echo '=>';
    }
    function agreePrice($id){
        $this->load->model("common_model");
         log_output("kais");
        $statusParam=array('uid'=>1,'add_user'=>1);
        $this->common_model->resetStatus($id,$statusParam);
    }
    function getSyncQue(){
        $this->load->service('/wms/inventory_track_service');
        $this->load->service('/wms/sap_service');
        $this->load->service('/wms/warehouse_list_service');
        $where = array(
            'sync_status' => 1,
            'type <> '=>1
        );
        $track_list = $this->inventory_track_service->get_list($limit = 0, $pagesize = 100, $orderstr = '', $where, $wherein = '', $like = '');
        echo '<br>';
        print_r($track_list);
        exit;
    }
    
    function getTime(){
        echo time();
        echo '<br>';
        echo date("Y-m-d H:i:s");
    }
    
}

